#include <bits/stdc++.h>

using namespace std;

const int MAXN = 400;

int n;

struct bignum{
	int len,arr[MAXN];
	bignum(int x=0):len(x){memset(arr,0,sizeof(arr));}
	int & operator [](int x){return arr[x];} const int operator [](int x)const{return arr[x];}
	void limit(){for(int i = 0;i <= len;i++) arr[i+1] += arr[i] / 10,arr[i] %= 10;while(arr[len+1]) {arr[len+1] += arr[len] / 10;arr[len] %= 10;len++;}while(arr[len] == 0 && len > 0) len--;}
	friend bignum operator + (bignum a,bignum b){
		bignum c(max(a.len,b.len));
		for(int i = 0;i <= c.len;i++) c[i] = a[i] + b[i];
		c.limit(); return c;
	}
	friend bignum operator * (bignum a,int x){
		bignum c(a.len+2);
		for(int i = 0;i <= a.len;i++) c[i] = a[i] * x;
		c.limit(); return c;
	}
	void out(){limit();for(int i = len;i>=0;i--) printf("%d",arr[i]);puts("");}
}f[MAXN];

int main (){
	scanf("%d",&n);
	f[1].len = 0;f[1].arr[0] = 0;f[2].len = 0;f[2].arr[0] = 1;
	for(int i = 3;i <= n;i++) f[i] = f[i-1] + f[i-2] ,f[i] = f[i] * (i-1);
	f[n].out(); return 0;
}
